import React from 'react'
import { CForm,Container,Button,FormControl } from '@/core';
import "./Login.less";

let smsBtn = function(){
    let [disabled,setDisabled] = React.useState(false)
    let sendSms = function(){
        setDisabled(true)
    }
    //
    return (
        <Button variant="contained" style={{marginLeft:"1em"}} disabled={disabled} onClick={sendSms}>获取验证码</Button>
    )
}


class Index extends React.Component {

    state = {
        columns:[]
    }

    constructor(props){
        super(props);
        this.state.columns = [
            {name:'name',text:'',type:'input',rules:['required'],
                props:{placeholder:"手机号"},
                InputProps:{startAdornment:<i className="icon icon_phone"/>}
            },
            {name:'pwd',text:'',type:'inputButton',rules:['required'],
                props:{placeholder:"短信验证码"},
                InputProps:{startAdornment:<i className="icon icon_phonev"/>},
                subfix:()=>{
                    return
                }
            },
            {name:'code',text:'',type:'input',rules:['required'],
                props:{placeholder:"密码"},
                InputProps:{startAdornment:<i className="icon icon_pwd"/>}
            },
        ];
    }

    UNSAFE_componentWillMount(){window.ss = this;
      //this.api('login.token',{})
    }

    render(){
        return (
            <div className="login_page fl-center">
                <div className="login_header">
                    <Container>
                        <img src="./img/logo.png" style={{width:"100px",padding:"5px 0",cursor:"pointer"}} onClick={()=>_.his.push('/')}/>
                    </Container>
                </div>
                <div className="login_box">
                    <div className="title">
                        欢迎登录
                    </div>
                    <CForm ref="form" xs={12} columns={this.state.columns}/>
                    <Button variant="contained" className="submit">登录</Button>
                    <div className="login_bottom flr">
                        <div className="flbox">
                            找回密码
                        </div>
                        <div className="flone">
                            扫码登录
                        </div>
                    </div>
                </div>
            </div>
        )
    }
}

export default Index;

